﻿using FluentMigrator;
using Smartstore.Core.Identity;
using Smartstore.Core.Stores;

namespace Smartstore.Core.Data.Migrations
{
    [MigrationVersion("2024-10-08 17:37:00", "Core: AddOriginalMapping")]
    internal class AddOriginalMapping : Migration
    {
        public override void Up()
        {
            var propTableName = nameof(OriginalMapping);
            if (!Schema.Table(propTableName).Exists())
            {
                Create.Table(propTableName)
                    .WithIdColumn()
                    .WithColumn(nameof(OriginalMapping.EntityId)).AsInt32().NotNullable()
                    .WithColumn(nameof(OriginalMapping.EntityName)).AsString(400).NotNullable()
                    .WithColumn(nameof(OriginalMapping.StoreId)).AsInt32().NotNullable()
                    .WithColumn(nameof(OriginalMapping.OriginalId)).AsInt32().NotNullable();
            }
        }

        public override void Down()
        {
        }
    }
}
